﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="MemberOrder" Object="MemberOrder" InnerID="Request.QueryString['ID']" Validate="True" />
<section data-page="member_order_view" data-title="会员订单详情" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">会员订单</a> → <b><%=MemberOrder[InnerID]%></b></dt>
	</dl>
	<form class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="edit.aspx?Lang=<%=ContentLang%>&ID=<%=MemberOrder[InnerID]%>" target="ali-navtab">会员订单详情</a></li>
						</ul>
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel">
						<div class="section1">
							<h1>基本信息</h1>
							<table class="post-table margin2">
								<tr>
									<th>订单总价：</th>
									<td><%=Convert.ToDecimal(MemberOrder[Sum]).ToString("0.00")%></td>
								</tr>
								<tr>
									<th>订单状态：</th>
									<td>
										<%If Convert.ToBoolean(MemberOrder[IsArchived])%>
											已归档
										<%ElseIf Convert.ToBoolean(MemberOrder[IsCanceled])%>
											已作废
										<%ElseIf Convert.ToBoolean(MemberOrder[IsFinished])%>
											已完成
										<%Else%>
											<%If Convert.ToInt32(MemberOrder[IsPayed]) == 0%>
												未付款
											<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 1%>
												部分付款
											<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 2%>
												已付款
											<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 3%>
												部分退款
											<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 4%>
												已退款
											<%EndIf%>
											，
											<%If Convert.ToInt32(MemberOrder[IsDelivered]) == 0%>
												未发货
											<%ElseIf Convert.ToInt32(MemberOrder[IsDelivered]) == 1 || Convert.ToInt32(MemberOrder[IsDelivered]) == 2%>
												已发货<br>
												<%If Convert.IsDBNull(MemberOrder[ExpiredTime])%>
													永不过期
												<%ElseIf Convert.ToDateTime(MemberOrder[ExpiredTime]) > DateTime.Now%>
													<%=Convert.ToDateTime(MemberOrder[ExpiredTime]).Subtract(DateTime.Now).Days%> 天后过期
												<%Else%>
													<%=DateTime.Now.Subtract(Convert.ToDateTime(MemberOrder[ExpiredTime])).Days%> 天已过期
												<%EndIf%>
											<%ElseIf Convert.ToInt32(MemberOrder[IsDelivered]) == 3%>
												已退货
											<%EndIf%>
										<%EndIf%>
									</td>
								</tr>
							</table>
						</div>

						<div class="section1">
							<h1>用户信息</h1>
							<table class="post-table margin2">
								<tr>
									<th>用户账号：</th>
									<td>
										<img src="<%=MemberOrder[UserHead]%>" style="width:22px;height:22px;vertical-align:middle"> <%=MemberOrder[UserNickname]%>
									</td>
								</tr>
								<tr>
									<th>会员等级：</th>
									<td class="<%=ContentLang%>Font">
										<ali:Get Object="MemberLevel" Guid="MemberOrder[LevelID]">
											<%=Name%>
										</ali:Get>
									</td>
								</tr>
							</table>
						</div>

						<div class="section1">
							<h1>支付信息</h1>
							<table class="post-table margin2">
								<tr>
									<th>付款状态：</th>
									<td>
										<%If Convert.ToInt32(MemberOrder[IsPayed]) == 0%>
											未付款
										<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 1%>
											部分付款
										<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 2%>
											已付款
										<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 3%>
											部分退款
										<%ElseIf Convert.ToInt32(MemberOrder[IsPayed]) == 4%>
											已退款
										<%EndIf%>
									</td>
								</tr>
								<%If Convert.ToInt32(MemberOrder[IsPayed]) > 0%>
									<tr><th>支付时间：</th><td><%=MemberOrder[PayTime]%></td></tr>
									<%If Convert.ToInt32(MemberOrder[IsPayed]) == 2 && Convert.ToString(MemberOrder[PaymentName]) == ""%>
										<tr><th>支付方式：</th><td>余额支付</td></tr>
										<tr><th>支付账号：</th><td><%=MemberOrder[UserID]%></td></tr>
									<%Else%>
										<tr><th>支付方式：</th><td><%=MemberOrder[PaymentName]%></td></tr>
										<tr><th>支付账号：</th><td><%=MemberOrder[PaymentAccountNo]%></td></tr>
									<%EndIf%>
								<%EndIf%>
								
								<%If Convert.ToInt32(MemberOrder[IsPayed]) == 3 || Convert.ToInt32(MemberOrder[IsPayed]) == 4%>
									<tr><th>退款时间：</th><td><%=MemberOrder[RefundTime]%></td></tr>
									<tr><th>退款备注：</th><td><%=MemberOrder[RefundMemo]%></td></tr>
								<%EndIf%>
							</table>
						</div>

						<div class="section1">
							<h1>发货信息</h1>
							<table class="post-table margin2">
								<tr>
									<th>发货状态：</th>
									<td>
										<%If Convert.ToInt32(MemberOrder[IsDelivered]) == 0%>
											未发货
										<%ElseIf Convert.ToInt32(MemberOrder[IsDelivered]) == 1 || Convert.ToInt32(MemberOrder[IsDelivered]) == 2%>
											已发货
										<%ElseIf Convert.ToInt32(MemberOrder[IsDelivered]) == 3%>
											已退货
										<%EndIf%>
									</td>
								</tr>
								<%If Convert.ToInt32(MemberOrder[IsDelivered]) > 0%>
									<tr><th>发货时间：</th><td><%=MemberOrder[DeliverTime]%></td></tr>
									<tr><th>发货备注：</th><td><%=MemberOrder[DeliverMemo]%></td></tr>
								<%EndIf%>
								
								<%If Convert.ToInt32(MemberOrder[IsDelivered]) == 5%>
									<tr><th>退货时间：</th><td><%=MemberOrder[ReturnTime]%></td></tr>
									<tr><th>退货备注：</th><td><%=MemberOrder[ReturnMemo]%></td></tr>
								<%EndIf%>
							</table>
						</div>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
	</form>
</section>